//
//  MAUIModule.m
//  MateAdv
//
//  Created by 茶 on 2023/9/8.
//

#import "CAUIModule.h"
#import "UIDevice+Addtion.h"

CGFloat CARatioScreenWidth(void){
    BOOL isPortrait =YES;
    CGFloat ratio;
    CGFloat base = [[UIDevice currentDevice] respondsToSelector:@selector(isPad)] && [UIDevice currentDevice].isPad ? isPortrait ? 768.0f : 1024.0f : 375.0f;
    CGFloat width = [[UIDevice currentDevice] respondsToSelector:@selector(isPad)] && [UIDevice currentDevice].isPad ? [UIScreen mainScreen].bounds.size.width : isPortrait ? [UIScreen mainScreen].bounds.size.width : [UIScreen mainScreen].bounds.size.height;
    ratio = width / base;
    return ratio;
}

CGFloat CARatioScreenHeight(void){
    BOOL isPortrait = UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation);
    CGFloat ratio;
    CGFloat base = [[UIDevice currentDevice] respondsToSelector:@selector(isPad)] && [UIDevice currentDevice].isPad ? isPortrait ? 1024.0f : 768.0f : 667.0f;
    CGFloat height = [[UIDevice currentDevice] respondsToSelector:@selector(isPad)] && [UIDevice currentDevice].isPad ? [UIScreen mainScreen].bounds.size.height : isPortrait ? [UIScreen mainScreen].bounds.size.height : [UIScreen mainScreen].bounds.size.width;
    ratio = height / base;
    return ratio;
}
